const a = 'hehe';
a.toJSON = function() {
  return 'haah';
}
const b = new String('cuvee');
b.toJSON = function() {
  return 'json';
}
console.log(b instanceof String);
console.log(JSON.stringify(a));
console.log(JSON.stringify(b));

const c = {
  name: 'cuvee',
  obj: {
    title: 'Deep into'
  },
  age: 30,
}

console.log(JSON.stringify(c));

// A -> B   B -> A
// const d = {};

// d.a = d;


// console.log(JSON.stringify(d))


const e = {
  [Symbol.for('#test')]: 'haha'
}

console.log(JSON.stringify(e, function(key, value) {
  if (typeof key === 'string') {
    return 'hjaha';
  }
}))

console.log(JSON.stringify(new Date()))

const m = new Map();

m.set('name', 'cuvee');

for (const a of m) {
  console.log(a);
}
console.log(JSON.stringify(m))